//
//  CustomField.m
//  MobileOffice
//
//  Created by jjkj on 16/11/8.
//  Copyright © 2016年 liaoningjujin. All rights reserved.
//

#import "CustomField.h"

@implementation CustomField


- (void)drawRect:(CGRect)rect {
    if (!_color) {
        _color=[UIColor lightGrayColor];
    }
    CGContextRef contextRef = UIGraphicsGetCurrentContext();
    // set to same colour as text
    CGContextSetStrokeColorWithColor(contextRef, self.color.CGColor);
    CGContextMoveToPoint(contextRef, 0, [self getView_Height]-1);
    CGContextAddLineToPoint(contextRef, [self getView_Width], [self getView_Height]-1);
    CGContextClosePath(contextRef);
    CGContextDrawPath(contextRef, kCGPathStroke);
}

- (void)setColor:(UIColor *)color{
    _color=[color copy];
    self.textColor=_color;
    [self setNeedsDisplay];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
